package com.yuanduo_app.db.waterdb

import androidx.room.Database
import androidx.room.Room
import androidx.room.RoomDatabase
import com.yuanduo_app.MainApplication


/**
 * versions:
 * coding by pmj on 2021/8/9
 * desc:
 */

@Database(entities = arrayOf(WaterData::class), version = 1)
abstract class WaterDataBase : RoomDatabase() {

    abstract fun waterDao(): WaterDao

}

/**
 * 获取数据库实例
 */
val waterDB: WaterDataBase by lazy {
    Room.databaseBuilder(
        MainApplication.getInstance(),
        WaterDataBase::class.java,
        "WaterDB"
    ).build()
}